
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpQuartzRelation.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpQuartzRelationForm"
 */
public class CcpQuartzRelationForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cqrGuid = null;
   private java.lang.String _cqwGuid = null;
   private java.lang.String _cqjGuid = null;

   /**
    * Standard constructor.
    */
   public CcpQuartzRelationForm() {
   }

   /**
    * Returns the cqrGuid
    *
    * @return the cqrGuid
    */
   public java.lang.String getCqrGuid() {
      return _cqrGuid;
   }

   /**
    * Sets the cqrGuid
    *
    * @param cqrGuid the new cqrGuid value
    */
   public void setCqrGuid(java.lang.String cqrGuid) {
      _cqrGuid = cqrGuid;
   }
   /**
    * Returns the cqwGuid
    *
    * @return the cqwGuid
    */
   public java.lang.String getCqwGuid() {
      return _cqwGuid;
   }

   /**
    * Sets the cqwGuid
    *
    * @param cqwGuid the new cqwGuid value
    */
   public void setCqwGuid(java.lang.String cqwGuid) {
      _cqwGuid = cqwGuid;
   }
   /**
    * Returns the cqjGuid
    *
    * @return the cqjGuid
    */
   public java.lang.String getCqjGuid() {
      return _cqjGuid;
   }

   /**
    * Sets the cqjGuid
    *
    * @param cqjGuid the new cqjGuid value
    */
   public void setCqjGuid(java.lang.String cqjGuid) {
      _cqjGuid = cqjGuid;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCqrGuid() == null) {
         errors.add("cqrGuid", new ActionError("error.cqrGuid.required"));
      }
      // TODO test format/data
      return errors;
   }
}
